
function init(){

	dojo.connect(dojo.byId("execute"),"onclick", function(){
		var params = dojo.query("#params input");

		var url = "Execute?uid="+document.getElementsByName("uid")[0].value
					+"&uAccess="+document.getElementsByName("uAccess")[0].value
					+"&object_name="+dojo.byId("object_name").value;

		for(var i=0; i<params.length; i++) {
			if(params[i].disabled == false) {
				url += "&"+params[i].name+"="+encodeURIComponent(params[i].value);
			}
			else{
				url += "&"+params[i].name;
			}
		}

       	var x = dojo.xhrGet({
		      url: url,
		      handleAs: "json",
		      load: function(response, ioArgs) {
       			for(var key in response){
       				document.getElementsByName(key)[0].value=response[key];

       			}
       			alert("Success!");

		      },
		      error: function(response, ioArgs) {
		        alert("ERROR:"+ response);
		      },
			  sync: true
		   });

	});


};

dojo.addOnLoad(init);

